**# Bookmark #1 Setting

*Windows
global root  = "G:/Dropbox/Environmental Injustice/Empirical"
global rawdata = "$root/rawdata"
global workdata = "$root/workdata"
global results = "$root/results"
global outfile = "$root/outfile"

cd "$workdata"


**# Bookmark #2 Figure 1
**# Bookmark #2.1 Figure 1(a)
*(A) Mandated COD Abatement Targets by Higher- and Lower- SES Cities"
use "$outfile/Figure 1a.dta",clear

twoway ///
    (bar mean group if group==0, lcolor(black) lwidth(medium) barwidth(0.5) color("51 102 153")) ///
    (bar mean group if group==1, lcolor(black) lwidth(medium) barwidth(0.5) color("153 51 51%50")) ///
    (rcap upper lower group, lcolor(black)), ///
    xscale(range(-0.5 1.5) noline) /// 
	xtitle("") ///
    xlabel(0 "Higher-SES Cities" 1 "Lower-SES Cities", nogrid) ///
    ytitle("Mean COD Abatement Targets (1,000 tons)",size(large)) ///
    ylabel(-7(1)3, nogrid) ///
	legend(off) ///
    yline(0, lpattern(solid) lcolor(black) extend) ///
    graphregion(lcolor(white) color(white)) ///
    plotregion(margin(zero) color(white)) 
	
graph export "$results/Figure 1a.pdf", as(pdf) name("Graph") replace

**# Bookmark #2.2 Figure 1(b)
*(B) Trends in COD Emission Exposure in Higher- and Lower- SES Cities"

use "$outfile/Figure 1b.dta",clear

twoway ///
	(connected codbyses year if belowcl_median==0, msymbol(t) lpattern(solid)) ///
	(connected codbyses year if belowcl_median==1, msymbol(o) lpattern(dash)), /// 
	xtitle("") ///	
	legend(position(4) ring(0) rows(1) order(1 "Higher-SES Cities" 2 "Lower-SES Cities")) ///
	ytitle("Mean COD Emissions (1,000 tons)",size(large)) xlabel(2001(1)2011) ///
	graphregion(lcolor(white) color(white)) ///
    plotregion(margin(zero) color(white)) ///
    ylabel(, nogrid)

graph export "$results/Figure 1b.pdf", as(pdf) name("Graph") replace




